Chris Pollett > Old Classes >
CS185c

( Print View )

Student Corner:
  [Grades Sec5]

  [Submit Sec5]

  [Class Sign Up Sec5]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Quizzes]  [Project]

Practice Exams:
  [Mid]  [Final]

                           












HW#2 --- last modified February 10 2019 21:54:07..

Solution set.

Due date: Mar 14

Files to be submitted:
  Hw2.zip

Purpose: To write code to preserve app state between invocations. To experiment with log writing as a tool to do debugging. To test out your app on an actual phone.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO1 -- Create a working mobile phone application and test it both in a simulator and on a mobile device.

LO2 -- Write a mobile application that involves GUI components and makes use of touch events to manipulate these components.

LO5 -- Write a mobile application that stores program data persistently using an API like sqlite.

Specification:

For this homework you are going to write an app to help you study for the SATs by allowing you to make flash cards on your phone for rare words and their definitions. Your app's UI will look different in portrait and landscape mode. In portrait mode, you should see a list of words and at least the first parts of their definitions. Above this list, there should be a plus-button which brings up a new view. On this new view, there should be two text fields, one where you can enter a word, and another where you can enter a definition. Beneath this there should be two buttons, for canceling or saving. Canceling just returns one to the previous view without changing what was set up there. Touching on the text fields should bring up the keyboard to enter data. Hitting return or tapping outside of the field should dismiss the keyboard. Completing the form and saving should add this word definition to the list on the portrait view. This list should display items in alphabetical order. Beneath the list, there should be a Delete List button. Touching this should cause a modal dialog to be displayed which asks the user to confirm whether they really want to delete the list. Only with the user's confirmation should the list be deleted.

In landscape mode, the screen of your app should have an area to display words and a Next Button -- the majority of the screen real estate should be dedicated to the former. In the display word area, a randomly chosen word from the word list is displayed. Touching next, chooses another word from the word list at random. Tapping on the word area, should "flip" the flash card over (+1 bonus to actually make a flipping animation) and reveal the definition on the back. Tapping again, should return the flash card to its previous state. If the flash card is revealing its definition and the user presses the Next button, the next word is brought up, not its definition.

Your app should make use of persistence. You should store the words so far into a sqlite database and you should re-read in the list when your app launches. In landscape mode, the word that was being displayed when the user left your app should be the word seen when the user comes back.

As the goal of this class is to write programs which will actually run on phones, one point of this assignment will to prove to me you can get your code running on a phone. On the day this homework is due, I will walk around class and verify this.

If you are taking CS286-1, I want you to write at least three unit tests (of what I'll let you decide) for this homework either using XCode's Unit Testing or Android's Junit Testing.

As usual there is 1 bonus point for doing this assignment for more than one platform (including HTML5).

Point Breakdown

Code is well-documented and follows departmental Java or standard Apple Coding guidelines. This point for CS286-1 students is for your unit tests. 1 pt
In class on device demo 1 pt
Persistence of cue card list between invocations; persistence of last word in landscape mode 1 pt
Plus button works as described 1 pt
Delete List Buttons and model dialog as described 1 pt
In add-word view keyboard and other buttons operate as described 1 pt
As words are added list stays in alphabetical order 1 pt
App supports rotation as the means of switching between portrait and landscape mode as described above. 1 pt
In landscape mode tapping the word reveals the definition 1 pt
In landscape mode clicking next operates as described 1 pt
Total10pts